#include "progressBar.h"

char  bar[102] = {0};
const char * s = "-/|\\";
const char* clour = BOLD;
char type = '-';
char tail = '>';

void PrintPBar(int pro)
{

    if(pro < 0 || pro > 100)return;
    int len = strlen(s);
    printf(BOLD "[%-100s]" RESET "[%d%%][%c]\r",bar,pro,s[pro%len]);
    bar[pro++] = type;
    fflush(stdout);
    if(pro < 100) bar[pro] = tail;
    else if(pro > 100) bar[0] = '\0';

}


//void PeintSet(char* cl,char ty);
